//package com.qen.epub
//
//import cn.hutool.core.io.file.FileReader
//
//import cn.hutool.core.lang.Console
//import com.qen.yanshen.ZhihuOutFile
//import nl.siegmann.epublib.domain.Book
//import nl.siegmann.epublib.domain.CreatorContributor
//import nl.siegmann.epublib.domain.MediaType
//import nl.siegmann.epublib.domain.Resource
//import nl.siegmann.epublib.epub.Epub2Writer
//import nl.siegmann.epublib.epub.Epub3Writer
//import nl.siegmann.epublib.epub.EpubWriter
//import nl.siegmann.epublib.service.MediatypeService
//import java.io.FileInputStream
//import java.io.FileOutputStream
//import java.io.InputStream
//
//const val EpubOutPath = "/Users/a1/Documents/Git/Kotlin/Eleven/out/epub"
//
//fun main() {
//
//}
//
//fun main2() {
//    val book = Book()
//    book.metadata.addCreator(CreatorContributor("Author Name"))
//    book.metadata.addTitle("Book Title")
//
//    val resource = Resource(ByteArray(0), "index.txt")
//    book.addSection("Chapter", resource)
//
//    val write = Epub2Writer()
//    write.write(book, FileOutputStream(EpubOutPath + "/demo.epub"))
//
//
//}
//
//
//fun main1() {
//
//    val fileReader = FileReader(ZhihuOutFile + "女儿的家庭保卫战.txt")
//    val result = fileReader.readString()
//    Console.log(result)
//    val book = Book()
//    book.metadata.addTitle("盐选神经病文章")
//    book.metadata.addCreator(CreatorContributor("MayBeTheGo"))
////    book.coverPage = Resource(FileInputStream(EpubOutPath + "/cover.html"), "cover.html")
////    book.coverImage = Resource(FileInputStream(EpubOutPath + "/cover.jpg"), "cover.jpg")
//
//    val resource = Resource(FileInputStream(EpubOutPath + "/cover.html"), "cover.html")
////    val resource = Resource("item1", result.toByteArray(), "女儿的家庭保卫战.txt", MediatypeService.XHTML)
////    resource.id = "item1"
////    resource.title = "女儿的家庭保卫战"
////    resource.mediaType = MediatypeService.XHTML
//    book.addSection("Chapter1", resource)
//
//    book.addResource(resource)
//
//    val writer: EpubWriter = Epub3Writer()
//    writer.write(book, FileOutputStream(EpubOutPath + "/demo.epub"))
//}
